﻿using Modules;
using AutoMapper;
using PmSoft;

namespace ManagementApi.Models.Payroll;

public class WagePayrollSettingDto : Modules.WagePayrollSetting
{
    #region 扩展属性
    //这里自行增加扩展属性
    #endregion
}

public static partial class WagePayrollSettingExceptions
{
    public static WagePayrollSettingDto AsDto(this Modules.WagePayrollSetting entity)
    {
        WagePayrollSettingDto dto = new();
        var mapper = ServiceAccessor.GetService<IMapper>();
        mapper.Map(entity, dto);
        #region 扩展属性赋值
        //这里自行给扩展属性赋值
        #endregion
        return dto;
    }

    public static IEnumerable<WagePayrollSettingDto> AsDtos(this IEnumerable<WagePayrollSetting> entitys)
    {
        List<WagePayrollSettingDto> dtos = new ();
        var mapper = ServiceAccessor.GetService<IMapper>();
        mapper.Map(entitys, dtos);
        return dtos;
    }
}
